package com.example.droideep.fragment.pager;

import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.droideep.R;

import java.util.List;

/**
 * @author bri
 * @date 15-5-19.
 */
public class PagerView extends IPagerView<PagerTest> {

    PagerTestAdapter pagerAdapter;

    @Override
    public void init(LayoutInflater inflater, ViewGroup container) {
        root = inflater.inflate(R.layout.fragment_view_pager, container, false);
        viewPager = (ViewPager) root.findViewById(R.id.view_pager);
    }

    @Override
    public View getView() {
        return root;
    }


    @Override
    public void setPagerAdapter(PagerTestAdapter pagerAdapter) {
        this.pagerAdapter = pagerAdapter;
        viewPager.setAdapter(pagerAdapter);
    }

    @Override
    public void setItems(List<PagerTest> items) {
        pagerAdapter.setItems(items);
    }
}
